<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Tipoprocessos extends CI_Controller {
	function __construct() {
		parent::__construct();
		if(!$this->session->userdata('disproju')){
			$this->session->sess_destroy();
			redirect('login', 'refresh');
		}
	}
	public function consultaTipoProcessoJson(){
		$term = $_GET['q'];
		$aux = array();
		$dados = array();
		
		$p = new TipoProcesso();
		$p->like('nomeprocesso', $term);
		$partes = $p->get();
		
		foreach($partes as $parte){
			$aux["id"] = $parte->id;
			$aux["name"] = $parte->nomeprocesso;
			array_push($dados,$aux);
		}
		echo json_encode($dados);
		
	
	}
	public function consultaTipoProcessoJsonInfo(){
		
		$aux = array();
		$dados = array();
		
		$p = new TipoProcesso();
		$p->get();
		
		foreach($p as $tp){
			$aux['id'] = $tp->id;
			$aux['name'] = $tp->nomeprocesso;
			array_push($dados,$aux);
		}
		return($dados);
		
	
	}
	
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */